# inkscapelite
# Builds from https://github.com/puppylinux-woof-CE/petbuilds

. ../func
. ../build.conf

URL=http://distro.ibiblio.org/puppylinux/sources/i/
PKG=inkscapelite
VER=0.36.3_patched-glib-rulers
COMP=tar.xz
DESC="Light weight vector graphics editor"
DEPS=+freetype2,+pango,+libxml2,+gtk+2,+cairo,+libpng,+atk
CAT=Graphic
DESKTOP=inkscape.desktop
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)	
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not	

ARCH=$(uname -m)
case $ARCH in
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

patch_me() {
	case $ARCH in
	 *64) for p in *.patch ;do
		patch -p0 < $p
		done ;;
	 *) patch -p0 < rulers.patch ;;
	esac
}

build() {
	# since not X compiling forget build triplet
	cd ${PKG}-${VER}
	./configure --prefix=/usr \
				--localstatedir=/var \
				--sysconfdir=/etc \
				--libdir=/usr/${LIBDIR}
	[ "$?" -eq 0 ] || exit
	sed -i 's%\-\-export-dynamic%%' src/Makefile #legacy
	make $MKFLG
	[ "$?" -eq 0 ] || exit
	make DESTDIR=$CWD/$PKG-install install
	cd -
}
	
# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
patch_me
build
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT	
